<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .btn{
            padding: 20px;
            border-radius: 5px;
        }
    </style>
</head>

<body>
    <button class="btn">点我</button>
    <button class="btn">添加</button>
    <button class="btn">移除</button>
    <div class="box"></div>
    <script src="jquery.min.js"></script>

    <script>
        $('.btn').eq(0).click(function () {
            $('.box').delay(2000)
                .css({ width: 200, height: 200 })
                .css('backgroundColor', 'pink')
                .css('opacity', '0.3')
                .animate({ width: 400 }, 2000, 'linear')          
        })

        $('.btn').eq(1).click(function () {
            $('.box').attr({
                'data-index': 0,
                title: '小米'
            })
        })

        $('.btn').eq(2).click(function () {
            $('.box').removeAttr('data-index')
        })
    </script>
</body>

</html>